package inv.cal.view;

import java.util.Enumeration;

import inv.cal.logic.Manager;

import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.TableColumn;

public class CalendarTableColumnModel extends DefaultTableColumnModel {
	private static final long serialVersionUID = 6855024459532670791L;
	
	@Override
	public void moveColumn(int columnIndex, int newIndex) {
//		super.moveColumn(columnIndex, newIndex);
	}
	
	public void updateColumnRenderers(Manager manager){
		Enumeration<TableColumn> columnEnum	= getColumns();
		TableColumn weekColumn	= columnEnum.nextElement();
		weekColumn.setCellRenderer(new WeekCellRenderer(manager));
		weekColumn.setResizable(false);
		DayCellRenderer dayCellRenderer = new DayCellRenderer(manager);
		while(columnEnum.hasMoreElements()){
			TableColumn dayColumn	= columnEnum.nextElement();
			dayColumn.setCellRenderer(dayCellRenderer);
			dayColumn.setResizable(false);
		}
	}
}
